from selenium.webdriver.common.by import By
from common.basepage import BasePage#倒父类
from pack_locator import locator as ll

class PackLogin(BasePage):#继承父类

    def __init__(self,driver):
        super().__init__(driver)#继承父类

    def login(self,name,passwd,code):#参数化
        # self.driver.find_element(*self.n).send_keys(name)#账户
        # self.driver.find_element(*self.p).send_keys(passwd)#密码
        # self.driver.find_element(*self.c).send_keys(code)#验证码
        # self.driver.find_element(*self.b).click()#确认
        self.input(ll.n,name,'用户名定位异常')
        self.input(ll.p,passwd,'密码定位异常')
        self.input(ll.c,code,'验证码异常')
        self.click(ll.b,'登录异常')
    def get_fail_massage(self):
        result=self.get_element(ll.m,'断言异常').text
        return result